<template>
	<view class="earlyWarning">
		<view class="" style="height: 160rpx;">
		<view class="mail_List fixed z_ninetynine">
			<view class="mail" style="font-weight: 700;">
				<view class="order">薪资查询</view>
			</view>
		</view>
		<view class="icon fixed z_ninetynine">
			<u-icon name="arrow-left" color="#fefefe" size="40" @click="navigateBack"></u-icon>
		</view>
			
		</view>
		<view class="box">
			<view class="choice">
				选择年月:
			</view>
			<view class="years" style="margin-left: 20rpx; text-align: center; line-height: 80rpx;" @click="show = true">
				{{newList}}
			</view>
			<text style="line-height: 80rpx;">—</text>
			<view class="years" style="margin-left: 20rpx; text-align: center; line-height: 80rpx;" @click="show2 = true">
				{{newList2}}
			</view>
		</view>
		<u-select v-model="show" mode="single-column" :list="list" @confirm="confirm"></u-select>
		<u-select v-model="show2" mode="single-column" :list="list2" @confirm="confirm2"></u-select>
		<!-- 考勤信息 -->
		<view class="data_Statistics" style="padding: 44rpx 24rpx 0 ;">
			<text style="font-weight: 700; font-size: 30rpx; color: #c4c4c4;">丨</text><text
				style="font-weight: 700; font-size: 30rpx;">考勤信息</text>
		</view>
		<view class="card" style="padding: 0 42rpx;">
			<u-form :model="form" ref="uForm">
				<view class=""
					style="display: flex; justify-content: space-between; border-bottom: 1px solid #f6f7f9; padding: 20rpx 0;">
					<text style="line-height: 70rpx;">姓名:</text>
					<view style="line-height: 70rpx; font-weight: 700;">{{particulars ? particulars.staffName : ' '}}</view>
				</view>
				<u-form-item label="手机号:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars ? particulars.staffPhone : ' '"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="出勤天数:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars ? particulars.attendanceDay : ' '"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="满勤天数:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars ? particulars.attendanceCountDay : ' '"
						:clearable="false" :disabled="true" />
				</u-form-item>
			</u-form>
		</view>
		<!-- 薪资信息 -->
		<view class="data_Statistics" style="padding: 44rpx 24rpx 0 ;">
			<text style="font-weight: 700; font-size: 30rpx; color: #c4c4c4;">丨</text><text
				style="font-weight: 700; font-size: 30rpx;">薪资信息</text>
		</view>
		<view class="card" style="padding: 0 42rpx;">
			<u-form :model="form" ref="uForm">
				<u-form-item label="应发工资:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars ? particulars.salary : ' '"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="满勤奖:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars ? particulars.fullAward : ' '"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="工龄奖:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars ? particulars.seniorityPay : ' '"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="代扣代缴社保费用:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars ? particulars.securityContribution : ' '"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="个人所得税:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars ? particulars.incomeTax : ' '"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="实发工资:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars ? particulars.realitySalary : ' '"
						:clearable="false" :disabled="true" />
				</u-form-item>
			</u-form>
		</view>
		<!-- 弹框 -->
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				list: [{
						value: '1',
						label: '2021'
					},
					{
						value: '2',
						label: '2020'
					},
					{
						value: '3',
						label: '2019'
					},
					{
						value: '4',
						label: '2018'
					},
					{
						value: '5',
						label: '2017'
					}
				],
				newList: '',
				show2: false,
				list2: [{
						value: '1',
						label: '1'
					},
					{
						value: '2',
						label: '2'
					},
					{
						value: '3',
						label: '3'
					},
					{
						value: '4',
						label: '4'
					},
					{
						value: '5',
						label: '5'
					},
					{
						value: '6',
						label: '6'
					},
					{
						value: '7',
						label: '7'
					},
					{
						value: '8',
						label: '8'
					},
					{
						value: '9',
						label: '9'
					},
					{
						value: '10',
						label: '10'
					},
					{
						value: '11',
						label: '11'
					},
					{
						value: '12',
						label: '12'
					}
				],
				newList2: '',
				// 车辆详情
				particulars:'',
			}
		},
		onLoad(val) {
			this.loginId  = uni.getStorageSync("setModel")
				// this.getListVehicleByIds()
		},
		methods: {
			// 管理员待审核详情
			getListVehicleByIds() { 
				this.$http.get('selectSalaryById',{
					deptId:this.loginId.deptId,
					month: this.newList+'-'+this.newList2
				}).then(res => {
					if(res.code==200) {
						this.particulars=res.data
					} else {
						this.particulars=''
						this.$refs.uToast.show({
							title: res.msg,
						})
					}
					// this.form.Induction=res.data.createTime
					console.log(res, '管理员待审核详情')
					// this.owners = res.data
				})
			},
			// 注意返回值为一个数组，单列时取数组的第一个元素即可(只有一个元素)
			confirm(e) {
				this.newList = e[0].label
				console.log(this.newList)
				console.log(e);
				if(this.newList!=''&&this.newList2!='') {
					this.getListVehicleByIds()
				}
			},
			confirm2(e) {
				if(e[0].label<10) {
					this.newList2 = '0'+e[0].label
				}else {
					this.newList2 = e[0].label
				}
				console.log(this.newList2)
				console.log(e);
				if(this.newList!=''&&this.newList2!='') {
					this.getListVehicleByIds()
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.earlyWarning {
		.mail_List {
			overflow: hidden;
			width: 100%;
			background-color: #f2f2f2;

			.mail {
				padding: 10rpx 0;
				// margin-top: 96rpx;
				color: #999999;
				font-size: 40rpx;
				background-color: #e5e5e5;
			}

			.order {
				text-align: center;
			}
		}

		.icon {
			position: absolute;
			top: 18rpx;
			left: 20rpx;
		}

		.box {
			display: flex;
			justify-content: center;
			height: 80rpx;
			margin-top: 32rpx;
			.choice {
				line-height: 80rpx;
			}

			.years {
				width: 160rpx;
				height: 80rpx;
				border-radius: 10rpx;
				background-color: #fbfbfb;
			}
		}

		/deep/.card {
			.u-form-item--left {
				flex: unset !important;
				width: unset !important;
			}
		}
	}
</style>
